/**
 * ifuner 制作 @18658226071@163.com
 */

"use strict"
import Main from "_comp/MainLayout"
import utils from "_libs/utils"

const otherRouter = utils.importAll(require.context("./", false, /\.js$/))
console.log("otherRouter", otherRouter)
export default [
    {
        path: "/",
        name: "_home",
        redirect: "/home",
        component: Main,
        children: [
            {
                path: "/home",
                name: "home",
                meta: {
                    title: "首页",
                    icon: "el-icon-s-home"
                },
                component: () => import("_views/home.vue")
            }
        ]
    },
    ...otherRouter,
    {
        path: "/login",
        name: "login",
        meta: {
            title: "登录",
            hideInMenu: true
        },
        component: () => import("_views/Login/Login.vue")
    },
    {
        path: "/401",
        name: "error_401",
        meta: {
            title: "权限不足",
            hideInMenu: true
        },
        component: () => import("_views/ErrorPage/401.vue")
    },
    {
        path: "/500",
        name: "error_500",
        meta: {
            title: "服务器出现问题",
            hideInMenu: true
        },
        component: () => import("_views/ErrorPage/500.vue")
    },
    {
        path: "/404",
        name: "error_404_page",
        meta: {
            title: "页面找不到了",
            hideInMenu: true
        },
        component: () => import("_views/ErrorPage/404.vue")
    },
    {
        path: "*",
        name: "error_404",
        meta: {
            hideInMenu: true
        },
        redirect: "/404",
    }
]
